package org.example.ymcc.feignclient;

import org.example.ymcc.domain.CourseDoc;
import org.example.ymcc.feignclient.fallback.ESFeignClientFallbackFactory;
import org.example.ymcc.result.JsonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient(value = "service-search",fallbackFactory = ESFeignClientFallbackFactory.class)
public interface ESFeignClient {
    @PostMapping("/search/batchSave")
    public JsonResult batchSave(@RequestBody List<CourseDoc> docList);

    @GetMapping("/search/getCourseDoc/{courseId}")
    public JsonResult getCourseDoc(@PathVariable("courseId")Long courseId);
}
